Image processing using processing by bands and fixed-size work buffer

ABSTRACT

A high-quality image processing apparatus capable of performing image transfer processing using a predetermined work buffer even if different decoding methods are used, without physically increasing the memory capacity. Image data in page description language is inputted into a host I/F unit from an external device such as a host computer. At step S 302,  a print mode of the input data is examined and a coding method is selected. Next, at step S 303,  a decoding method corresponding to the coding is checked, and at step S 304,  a band height (width) is set in correspondence with the decoding method. If the decoding method is a non-realtime decoding method, the band height is reduced to half of that in case of realtime decoding method.

FIELD OF THE INVENTION

The present invention relates to an image processing apparatus, having a function to perform rasterizing in band units, performs rendering, and an image processing method.

BACKGROUND OF THE INVENTION

Conventionally, as an image processing apparatus of this type, a so-called page printer is known. In this apparatus, image processing is performed while holding raster data for one page in a raster memory. The raster data in such image processing apparatus includes not only text but also various images such as a simple figure and a photograph.

In recent years, the resolution of this image processing apparatus has improved, and the memory capacity necessary in accordance with the improvement in resolution has increased. For example, in a resolution of 600 dpi, for generating data for an A4-sized page, a 4 MByte memory is required. The tonality, with which 1 pixel has been conventionally represented by 2 levels, has improved from 16 (4 bits) to 256 (8 bits) levels, thus requiring a larger raster memory. Further, recently, color data is handled in many cases. In such cases, in YMCK space, in comparison with a case of monochrome image processing, the memory capacity for further 4 planes is required, therefore, the memory size is further increasing.

To cut costs increased by such increase in memory size, various memory-saving techniques are proposed. For example, the quantity of a raster memory is suppressed by holding raster data of a band-size and encoding the raster data of bands.

However, in known decoding methods, it is necessary to temporarily store decoded data in a buffer before video transfer is performed to a printer engine. To prevent data underflow to the print engine, it is necessary to perform parallel processing to video transfer one band from one buffer to the printer engine while decode the next band in another buffer. According to the method, two work buffers are necessary, and in comparison with a decoding method in which a work buffer is not required, redundant memories are required. Thus the memory area for storing coded data is reduced.

SUMMARY OF THE INVENTION

The present invention has been made to solve the above-described conventional problems, and has its object to provide a high-quality image processing apparatus and image processing method capable of image transfer processing by using a fixed size work buffer, even if different decoding methods are used, without physically increasing the memory.

To attain the above object, the present invention provides an image processing apparatus comprising: first coding means for performing coding by band having a predetermined height; first decoding means for decoding data coded by said first coding means into bitmap data; memory means for storing bitmap data for one band decoded by said first decoding means; second coding means for encoding the bitmap data stored in said memory means by a coding method selected from plural coding methods; and second decoding means for selecting and performing a first decoding method capable of transferring the bitmap data to a printer engine in realtime, or a second decoding method which needs to render the bitmap data before transferring the data to the printer engine, in accordance with the coding method selected by said second coding means, wherein before coding is performed by said first coding means, decoding processing performed by said second decoding means is predicted, and if the predicted decoding processing is the second decoding processing, the band height is reduced to half of that in case of the first decoding processing; and a method therefor.

Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same name or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

FIG. 1 is a schematic cross-sectional view showing the structure of an image processing apparatus according to an embodiment of the present invention;

FIG. 2 is a block diagram showing the construction of a printer control unit of the image processing apparatus;

FIG. 3 is a flowchart showing the flow of entire page generation processing in the image processing apparatus;

FIG. 4 is a flowchart showing the flow of coding method selection processing in the image processing apparatus;

FIG. 5 is a flowchart showing the flow of decoding method checking processing in the image processing apparatus;

FIG. 6 is a flowchart showing the flow of band-height setting processing in the image processing apparatus;

FIG. 7 is a flowchart showing the flow of coded-page generation processing in the image processing apparatus;

FIG. 8 is a flowchart showing the flow of decoding and transfer processing in the image processing apparatus;

FIG. 9 is a flowchart showing the flow of realtime decoding processing in the image processing apparatus;

FIG. 10 is a flowchart showing the flow of non-realtime decoding processing in the image processing apparatus;

FIG. 11 is a flowchart showing the flow of 2-band parallel processing in the image processing apparatus;

FIGS. 12 and 13 are block diagrams explaining the 2-band parallel processing in the image processing apparatus;

FIG. 14 is a block diagram explaining an image processing technique of the present invention; and

FIGS. 15 and 16 are block diagrams explaining image processing techniques according to the embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

A preferred embodiment of the present invention will now be described in detail in accordance with the accompanying drawings. Note that relative positioning of constituent elements, expressions, numerical values and the like described in the present embodiment do not limit the scope of the invention as long as there is no specific description.

<First Embodiment>

[Construction]

FIG. 1 is a cross-sectional view showing the structure of a laser beam printer (hereinafter abbreviated to “LBP”) according to an embodiment of the present invention. The LBP is capable of character pattern registration from a data source (not shown) and fixed format (form data) registration.

In FIG. 1, reference numeral 1000 denotes an LBP main body which inputs and stores character information (character code), form information or a macro command supplied from an externally-connected host computer, generates a corresponding character pattern or a form pattern in accordance with the information, and forms an image on a print sheet as a printing medium.

Numeral 1012 denotes an operation panel having switches for operation, an LED display and the like; and 1001, a printer control unit which controls the overall LBP 1000 and interprets character information or the like supplied from the host computer. The control unit 1001 mainly converts character information into a video signal of corresponding character pattern and outputs the signal to a laser driver 1002.

The laser driver 1002 is a circuit to drive semiconductor laser 1003. The laser driver 1002 turns on/off laser light 1004 emitted from the semiconductor laser 1003 in accordance with the input video signal.

The laser light 1004 is swept leftward and rightward by a rotary polygon mirror 1005, and scans on an electrostatic drum 1006. Thus an electrostatic latent image is formed on the electrostatic drum 1006. The latent image is developed by a developing unit 1007 around the electrostatic drum 1006, and is transferred to a print sheet.

The print sheet, which is a cut sheet, is set in a paper cassette 1008. The print sheet is fed into the apparatus with a paper-feed roller 1009 and conveyance rollers 1010 and 1011, and supplied to the electrostatic drum 1006.

FIG. 2 is a block diagram showing the construction of the control unit 1001 in the LBP 1000.

Numeral 2001 denotes an external device such as a host computer; 2003, an address data bus; 2004, a host I/F including a buffer; 2005, a CPU which controls the control unit; 2006, a ROM in which programs for control-unit control and the like are stored; 2007, a DMA controlled by the CPU; 2008 a panel unit; 2009, an I/F circuit including an output buffer for storing data to be sent to an engine 2011; and 2010, a RAM.

[Processing Technique]

Next, an image processing technique of the present invention will be described with reference to the block diagram of FIG. 14.

First, the control unit 1001 of the printer 1000 inputs image data in page description language (PDL) generated by the external device 2001 into the host I/F 2004.

Then, the CPU 2005 functions as a band-coded representation forming unit 1401 in accordance with a program for band coding processing stored in the ROM 2006, to convert the page description language inputted from the external device 2001 into band-coded representation information where the data is divided in band units, and store the information in a band code area 1402 secured in the RAM 2010. The band-coded representation information is a generic name of drawing objects divided in band units, such as “bitmap”, “run length”, “trapezoidal”, “box”, and “high-speed boundary-coded bitmap” with a background pattern, and a drawing logic upon rendering them in a raster memory. Note that the details of the band-coded representation information are disclosed in Japanese Published Patent Application No. Hei 6-87251.

Next, the CPU 2005 renders the band-coded representation information in band units by using a rendering unit 1404, and stores the information into a band raster area 1403.

When the rendered raster data has been stored in the band raster area, the CPU 2005 sends a first band via a transfer unit 1405 to the engine 2011 to output the band. While the raster data of the band is outputted, raster data of the next band is rendered in another band raster area 1403. In this manner, data can be outputted from the printer engine without causing data underflow by alternately performing rendering in the band raster area and transfer. Further, at the same time of transfer (print) operation, band-coded representation of the next page is generated.

However, in some cases, image data includes many complicated drawing objects and the band code area 1402 becomes full, accordingly, all the drawing objects cannot be stored as the band-coded representation information. For example, there is a possibility that in one band area in band code area, all the objects to be rendered are not always stored. In this case, as all the drawing objects do not exist in the band code area 1402, if the data is raster-rendered in the band raster area 1403 as described above, a drawing object which cannot be outputted is generated.

[Characteristic Processing Technique]

To solve the above problem, the coded representation is temporarily rendered, and encoded again by a high-compression rate coding method, such that all the image information is stored in the band code area. At this time, the control unit 1001 performs the following page generation processing.

FIG. 3 is a flowchart showing the entire page generation processing.

At step S301, image data is inputted into the host I/F unit 2004 from the external device such as a host computer. It is preferable that the image data inputted from the host I/F unit 2004 is not in full-raster image format of print image but in compact data format such as page description language (PDL) designating an object or object position on a page. However, the image data may be in any other image data format than the PDL format.

At step S302, the print mode of the input data is interpreted and a coding method is selected. Next, at step S303, a decoding method corresponding to the coding is checked, and at step S304, a band height (width) is set in accordance with the decoding method. In this example, if the decoding method is a non-realtime decoding method, the band height is reduced to half of that in realtime decoding method.

The realtime decoding method is a method in which video transfer to a printer engine after decoding is capable of video-transferring decoded data without temporarily storing the data in a work buffer. Further, “band” is a generic name of each of several same-size strip-shaped data obtained by dividing one-page data in a number of strips. The height of each strip is defined as a band height.

At steps S305 to S307, page generation and transfer processing is performed based on the band height set at step S304.

FIG. 15 shows the page generation and transfer processing in a case where the decoding processing is performed by the realtime decoding method in accordance with the result of checking at step S303.

The input PDL is converted into band-coded representation in the band-coded representation forming unit 1401 and stored into the band code area 1402. If all the image information cannot be stored in the presecured band code area, the information is rendered by the rendering unit 1404 by band, and stored into the ban raster area 1403. The band raster area has a capacity for storing bitmap data for one band. In this example, the band raster area 1403 and the band code area 1402 are separately provided, however, both areas exist on the RAM 2010. If the band raster area 1403 requires a larger area, the band code area 1402 is reduced. This relation is the same in FIG. 16.

The bitmap data stored in the band raster area 1403 is encoded by the CPU 2005 functioning as the encoder 1501 by the method selected at step S302. The coded data is stored in a compressed band area 1503. The band code area 1402 is sequentially released corresponding to the bands stored in the compressed band area 1503. When coded data for one page has been stored in the compressed band area 1503, a decoder 1502 decodes the data by band, and sequentially transfers decoded bitmap data via the transfer unit 1405 to the printer engine.

FIG. 16 shows the page generation and transfer processing in a case where the decoding processing is performed by the non-realtime decoding method in accordance with the result of checking at step S303.

The input PDL is converted into band-coded representation in the band-coded representation forming unit 1401, and stored into the band code area 1402. At this time, the band height is set to the height set at step S303, i.e., half of that in the realtime decoding method.

If all the image information cannot be stored in the pre-secured band code area, the information is rendered by the rendering unit 1404 by band, and stored into the band raster area 1403. The band raster area has a capacity for storing bitmap data for one band.

The bitmap data stored in the band raster area 1403 is encoded by the CPU 2005 functioning as the encoder 1501 by the method selected at step S302. Then the coded data is stored into the compressed band area 1503.

When coded data for one page has been stored in the compressed band area 1503, the decoder 1502 decodes the data by band, and renders the data in the band raster 1403. The band raster must have a capacity for two bands to transfer bitmap data to the printer engine without interruption. While rendering bitmap data in the band raster for one band, bitmap data from the other band raster is sequentially transferred to the printer engine. That is, two band rasters are used as a double buffer for parallel processing. Since the band height has been set to half in advance, in comparison with the case of decoding processing by using the realtime decoding method, the necessary band raster area does not increase to reduce the other memory area.

Hereinbelow, the respective processing at steps S302 to S304 and steps S306 to S307 will be described.

[Coding Method Selection]

FIG. 4 is a flowchart showing in detail the coding method selection processing at step S302.

At step S401, mode checking is performed. The mode in this case is one of color mode, monochrome mode, image mode and the like of data to be print-outputted. The color mode can be selected only in use of color printer. If it is determined in the mode checking at step S401 that the mode is the image mode, a coding method 1 is selected at step S402, and at step S405, the coding method 1 is set as the coding method.

Similarly, if it is determined in the mode checking at step S401 that the mode is the color mode, a coding method 2 is selected at step S403, and at step S405, the coding method 2 is set as the coding method. Further, if it is determined i the mode checking at step S401 that the mode is the monochrome mode, a coding method 3 is selected at step S404, and at step S405, the coding method 3 is set as the coding method.

Note that if the conditions of the image mode and the color mode or the monochrome mode overlap with each other, the image mode has a higher priority than the other modes in mode selection. Then, when coding method determination by mode has ended, the coding method selection processing ends at step S406.

[Decoding Method Checking]

FIG. 5 is a flowchart showing in detail the decoding method checking processing at step S303.

At step S501, the coding method selected at step S302 is obtained. At step S502, it is checked whether or not the realtime decoding method exists as a decoding method corresponding to the coding method obtained at step S501.

If it is determined at step S502 that the realtime decoding method exists, the realtime decoding method is set as the decoding method at step S503. On the other hand, if it is determined at step S502 that the realtime decoding does not exist, the non-real decoding method is set as the decoding method. When the decoding method has been set, the process ends.

[Band Height Setting]

FIG. 6 is a flowchart showing in detail the band-height setting processing at step S304.

Generally, the band height is determined relatively based on an area for storing one-page data. The larger the height is, the less the amount of boundary raster between bands is, i.e., the smaller the amount of overlapped data, therefore, memory efficiency is higher. In this embodiment, the set band height is “H”.

At step S601, the set band height (H) is obtained.

At step S602, the decoding method checked at step S303 in FIG. 3 is obtained.

At step S603, if the decoding method obtained at step S602 is the non-realtime decoding method, the process proceeds to step S604, at which the band height is set to half (H/2). On the other hand, if the decoding method obtained at step S602 is the realtime decoding, the process proceeds to step S605, at which the band height is set with the same value (H).

Then the band-height setting processing ends.

[Coding Processing]

In band-coded representation, if all the image information cannot be stored in the band code area, a coded page is generated by processing as shown in FIG. 7.

FIG. 7 is a flowchart showing in detail the coded-page generation processing at step S306.

At step S701, a work memory is allocated. The work memory here means a band raster area for storing decoded bitmap data. The work memory has a capacity the same as that of the band generated in proportion to the band height determined at step S304. At step S702, a value “n” indicating a band number is initialized to “0”. The value “n” is an integer satisfying 0<=n<=n _(—) max n_max: an integer as a maximum band number At step S703, it is checked whether or not the value “n” indicating the current band number exceeds “n_max”. If the value “n” exceeds “n_max”, it is determined that all the bands have been processed, and the processing ends at step S708. If it is determined at step S703 that the value “n” does not exceeds “n_max”, the process proceeds to step S704.

At step S704, the band-coded representation at step S305 is rendered in the work memory obtained at step S701.

Next, at step S705, the bitmap data rendered in the work memory at step S704 is encoded by the coding method selected at step S302 in FIG. 3.

At step S706, the coded data is stored into the compressed band area 1503.

At step S707, the current band number “n” is incremented for the next band (n=n+1).

The process returns to step S603, at which the above processing is repeated to the final band, then the coded-page generated processing ends.

[Decoding and Transfer Processing]

FIG. 8 is a flowchart showing in detail the decoding and transfer processing at step S307.

At step S801, it is checked whether the coding method selected by the decoding method checking at step S303 in FIG. 3 is a realtime decoding method or a non-realtime decoding method. If the decoding method is a realtime decoding method, the process proceeds to step S803, at which the realtime decoding processing is performed, while if the decoding method is a non-realtime decoding method, the process proceeds to step S802, at which band decoding processing is performed.

FIG. 9 is a flowchart showing in detail the realtime decoding processing at step S803.

At step S901, a realtime decoding method is selected as the decoding method. At step S902, the current band number “n” is initialized to “0”. Note that the number “n” is an integer satisfying 0<=n<=n _(—) max n_max: an integer as a maximum band number At step S903, it is checked whether or not the current band number “n” exceeds “n_max”. If the number “n” exceeds “n_max”, it is determined that all the bands have been decoded, and the process proceeds to step S906, at which the realtime decoding processing is terminated. On the other hand, if the current band number “n” does not exceeds “n_max”, the process proceeds to step S904.

At step S904, coded data of the “n”-th band is converted into a video signal and transferred to the printer engine while coded data is decoded, thus decoding and transfer of the band is performed.

At step S905, the current band number “n” is incremented for the next band “n=n+1”.

Then the process returns to step S903, at which the above processing is repeated to the final band, then the realtime decoding processing ends, and the decoding and transfer processing ends.

On the other hand, if it is determined at step S801 in FIG. 8 that the decoding method is a non-realtime decoding method, the non-realtime decoding processing is performed at step S802. The details of the non-realtime decoding processing will be described with reference to the flowchart of FIG. 10.

At step S1001, a non-realtime decoding method is selected as the decoding method. Next, at step S1002, band processing performed. The details of the band processing will be described with reference to the flowchart of FIG. 11.

At step S1101, a work memory for two bands is obtained. The work memory has a memory size twice of that of the work memory obtained at step S701 in FIG. 7, but the memory size is the same as that of the work memory obtained upon realtime decoding (H/2×2). That is, as the band height is reduced to half, there is no difference in the size of the work memory between realtime decoding and non-realtime decoding. The respective work memories will be referred to as a work memory 1 and a work memory 2.

First, at step S1102, 0-th band coded data is decoded and stored into the work memory 1.

At step S1103, the current band number “n” is initialized to “1”.

Note that the number “n” is an integer satisfying 1<=n<=n _(—) max n_max: an integer as a maximum band number

At step S1104, it is checked whether or not the current band number “n” exceeds the final band “n_max”. If the number “n” does not exceed the final band “n_max”, the process proceeds to step S1105.

At step S1105, “n−1”-th band from the work memory 1 is converted into a video signal and transferred to the printer engine, thus decoding and transfer processing is performed on the “n−1”-th band. First, the 0-th band data decoded at step S1102 is processed. In parallel to this processing, the “n”-th band data is decoded and the decoded data is stored into the work memory 1. First, the 1-th band coded data is decoded and stored into the memory.

The process proceeds to step S1106, at which the current band number “n” is incremented to the next band number (n=n+1)

FIGS. 12 and 13 illustrate these processing.

First, in FIG. 12, the “n”-th band decoded data, already decoded and stored in the work memory 1, is converted into a video signal and transferred to the printer engine, while the “n+1”-th band coded data is decoded and stored into the work memory 2.

Next, in FIG. 13, the data decoded in the work memory 1 in FIG. 12 is similarly converted into a video signal and transferred to the printer engine, on the other hand, as the “n”-th band data, already converted to the video signal is unnecessary, decoding is performed on “n+2”-th band data in the work memory 1.

The processing in FIGS. 12 and 13 is continued till the final band is processed.

Note that in this processing, decoding and storage to one work memory must be completed before the completion of video transfer from the other work memory to the printer engine.

Next, the process returns to step S1104 to continue the above processing until the final band is processed.

If it is determined at step S1104 that the final band has been processed, the decoding and transfer processing ends.

[Other Embodiments]

In the above embodiment, the image mode, the color mode and the monochrome mode are handled in mode selection, however, other modes may be used.

In the above embodiment, three types of coding methods are used, however, the number of types of coding methods is not limited.

In the above embodiment, two or more bands are handled, however, more bands may be handled.

In the above embodiment, the work memory is allocated upon coding and decoding, however, a fixed area may be provided.

In the above embodiment, two or more bands are handled, however, a single band may be handled.

In the above embodiment, in mode selection, if the image mode and the color mode or monochrome mode overlap with each other, the image mode is a higher priority in mode selection, however, another mode may be a higher priority.

The present invention can be applied to a system constituted by a plurality of devices (e.g., a host computer, an interface, a reader and a printer) or to an apparatus comprising a single device (e.g., a copy machine or a facsimile apparatus).

Further, the object of the present invention can be also achieved by providing a storage medium storing program code for performing the aforesaid processes to a system or an apparatus, reading the program code with a computer (e.g., CPU, MPU) of the system or apparatus from the storage medium, then executing the program. In this case, the program code read from the storage medium realizes the functions according to the embodiment, and the storage medium storing the program code constitutes the invention. Furthermore, besides aforesaid functions according to the above embodiment are realized by executing the program code which is read by a computer, the present invention includes a case where an OS (operating system) or the like working on the computer performs a part or entire processes in accordance with designations of the program code and realizes functions according to the above embodiment.

Furthermore, the present invention also includes a case where, after the program code read from the storage medium is written in a function expansion card which is inserted into the computer or in a memory provided in a function expansion unit which is connected to the computer, CPU or the like contained in the function expansion card or unit performs a part or entire process in accordance with designations of the program code and realizes functions of the above embodiment.

Where the present invention is applied to the aforesaid storage medium, the storage medium stores program code corresponding to the above-described flowcharts (especially FIG. 3 and FIG. 6)

According to the present invention, image transfer processing can be performed by using a fixed size work buffer even if different decoding methods are used. Thus, high-quality image processing apparatus and image processing method capable of high-quality image processing without physically increasing memory capacity can be provided.

As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific embodiments thereof except as defined in the appended claims. 

1. An image processing apparatus for input print data of page description language comprising: coded representation generation means for analyzing the print data of page description language and generating band coded representations in a unit of band having a predetermined height; rendering means for rendering bitmap data in a unit of band based on the band coded representations; memory means for storing the bitmap data for one band rendered by said rendering means; coding means for selecting a coding method from plural coding methods and encoding the bitmap data stored in said memory means by the selected coding method; and decoding means for selecting and performing a first decoding method of decoding the bitmap data coded by said coding means and transferring the decoded bitmap data decoded by the decoding means to a printer engine in realtime, or selecting and performing a second decoding method which needs to render the decoded bitmap data decoded by the decoding means into a work memory before transferring the decoded bitmap data decoded by the decoding means to the printer engine, in accordance with the coding method selected by said coding means, wherein a decoding method performed by said decoding means is predicted on the basis of the analysis result by said coded representation generation means, and if the predicted decoding method is the second decoding method, the band height is reduced to half of the band height of the first decoding method.
 2. The image processing apparatus according to claim 1, further comprising coded representation generation means for converting input image data in page description language into coded representation including at least one of a bitmap object, a run length object, a trapezoidal object, a box object, and a fixed-boundary code object.
 3. The image processing apparatus according to claim 1, further comprising image-type discrimination means for discriminating an image type of image data, wherein said coding means selects, from plural coding methods, a coding method corresponding to the image type discriminated by said image-type discrimination means, and performs coding by the selected coding method.
 4. An image processing method for input print data of page description language comprising: a coded representation generation step of analyzing the print data of page description language and generating band coded representations in a unit of band having a predetermined height; a rendering step of rendering bitmap data in a unit of band based on the band coded representations; a storing step of storing the bitmap data for one band rendered in said rendering step; a coding step for selecting a coding method from plural coding methods and of encoding the bitmap data stored in said storing step by the selected coding method; and a decoding step of selecting and performing a first decoding method of decoding the bitmap data coded in said coding step and transferring the decoded bitmap data decoded in said decoding step to a printer engine in realtime, or selecting and performing a second decoding method which needs to render the decoded bitmap data decoded in said decoding step into a work memory before transferring the decoded bitmap data decoded in said decoding step to the printer engine, in accordance with the coding method selected in said coding step, wherein, a decoding method performed in said decoding step is predicted on the basis of the analysis result of said coded representation generation step, and if the predicted decoding method is the second decoding method, the band height is reduced to half of the band height of the first decoding step.
 5. The image processing method according to claim 4, further comprising a coded representation generation step of converting input image data in page description language into coded representation including at least one of a bitmap object, a run length object, a trapezoidal object, a box object, and a fixed-boundary code object.
 6. The image processing method according to claim 4, further comprising an image-type discrimination step of discriminating an image type of image data, wherein said coding step includes selecting, from plural coding methods, a coding method corresponding to the image type discriminated in said image-type discrimination step, and performing coding by the selected coding method. 